<script setup>

let parent = defineProps({
  // 确认弹框标题，必填
  title: {type: String, required: true},
  // 点击确认按钮时触发的函数
  callback: {type: Function, required: false},
  // 确认按钮尺寸，默认 "small"
  size: {type: String, required: false, default: 'small'},
  // 确认按钮文案，默认 "确认操作吗？"
  label: {type: String, required: false, default: '确认操作吗？'},
  // 确认按钮颜色，默认 "danger"
  type: {type: String, required: false, default: 'danger'},
  // 是否为简单按钮，默认 true
  plain: {type: Boolean, required: false, default: true},
});
</script>

<template>
  <el-popconfirm class="my-confirm"
                 :title="title"
                 @confirm="callback">
    <template #reference>
      <el-button class="confirm-btn"
                 :type="type"
                 :plain="plain"
                 :size="size">
        {{ label }}
      </el-button>
    </template>
  </el-popconfirm>
</template>

<style scoped lang="scss">

</style>